home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_128 / dis / dis.doc < prev    next >
Text File  |  1992-05-06  |  8KB  |  183 lines

  1.  
  2. Dis   68000 disassembler
  3. Greg Lee, February, 1986
  4.  
  5. The program Dis, its source code, and
  6. this document are in the public domain.
  7.  
  8.       Commands to Dis are:
  9.  
  10.      <CR>, which repeats the last listing command ('l','b','B','d', or
  11.            'a') 21 times
  12.      <command-letter><CR>, where command-letter is a single character
  13.            from the list below
  14.      <command-letter><argument><CR>, where the argument follows
  15.            immediately after the command-letter
  16.  
  17. In the list below, arguments in '[...]' are optional, and 'addr' is
  18. either a hexadecimal number or a symbol. One must enter numbers
  19. beginning with digits A-F with a leading 0, so they can be distinguished
  20. from symbols. Note that there is no provision for ignoring spaces before
  21. or after the command-letter.
  22.  
  23.  command    argument  what it does
  24.  
  25.       l      [addr]    list instructions
  26.             Instructions are disassembled in a format which
  27.             would be acceptable to a standard assembler, except
  28.             that program counter relative references are given
  29.             as hex addresses without a leading '$'.  Such
  30.             addresses would have to be assigned a symbolic
  31.             value before any reassembly.
  32.       b      [addr]    build symbols
  33.             This does the same as 'l' above, except that symbols
  34.             are made and added to the symbol table for any
  35.             operand references which are PC relative, or
  36.             absolute long. Symbols are not constructed for
  37.             immediate opereands. Symbols are given types
  38.             if they appear to be references to data (see the
  39.             note below on symbol types). The operand of LEA
  40.             is assumed by Dis to refer to instructions,
  41.             although this is usually not the case. The target
  42.             of JSR or BSR is given a symbol beginning with 'R',
  43.             which will cause a preceding blank line when it is
  44.             listed as a label.
  45.       B      [addr]    Build locals
  46.             This does the same as 'l' above, except that certain
  47.             symbols that were probably made with the 'b' command
  48.             are replaced with local labels of the form '1$',
  49.             '2$',...,'999$'. The labels susceptible to
  50.             replacement are those which begin with 'l' and are
  51.             7 characters in length. When a label not of this
  52.             form is encountered in the listing, a counter is
  53.             reset so that the next local generated will be '1$'.
  54.       d      [addr]    dump in hex
  55.       a      [addr]    ascii dump
  56.       /      addr      address is this
  57.             This assigns a new current address for the next
  58.             listing command or symbol assignment, but
  59.             nothing is listed. Convenient for assigning a
  60.             symbol to an IO location which should not be
  61.             accessed.
  62.       =      <symbol>  add symbol to table
  63.             The string following the '=' is stored in the
  64.             symbol table with a value equal to the address of
  65.             the last instruction or data that was listed.
  66.             The space available for the table is fixed at
  67.             1600 symbols containing 11,200 characters. Space
  68.             occupied by no longer used symbols is not
  69.             automatically reclaimed, but it may be reclaimed
  70.             by saving the table to disk, then reading it back.
  71.       r      [<name>]  read file (symtab)
  72.             A file of symbols and the addresses to which they
  73.             refer is read from disk into Dis's symbol table.
  74.             Any symbols already in the table are lost.
  75.             The file will commonly have been created by by
  76.             the 's' command below, but it could have been
  77.             made or modified with an editor. Each line of
  78.             the file should either be empty or consist of
  79.             a hex number followed by exactly one space, and
  80.             then the string of characters that is to make
  81.             up the symbol name.
  82.       s      [<name>]  save to file (symtab)
  83.             Any symbols currently in the table are saved in
  84.             the file for future use. For both 'r' and 's', if
  85.             no name is given, 'symtab' is assumed.
  86.       q                quit
  87.             Exit to AmigaDos.
  88.       w      <num>     where is this word?
  89.       W      <num>     where is this longword?
  90.             These two commands start searching memory at
  91.             the current listing address, but skip memory
  92.             from 80000 to FC0000.
  93.       f      <name>    file to disassemble
  94.             The requested file is loaded and its first
  95.             instruction is listed. The file must be a load
  96.             module. If for some reason the file could not be
  97.             loaded, the IO error code is shown in hex.
  98.       >                next code segment
  99.             The segments of a load module are scattered in
  100.             memory by the AmigaDos loader. This command
  101.             alters the current listing address to the beginning
  102.             of the code segment after the current one (which
  103.             is the first segment, after a successful use of
  104.             the 'f' command). If nothing is listed, this means
  105.             there is no next segment (or, in 'p' mode, that the
  106.             next segment is empty).
  107.       <                first code segment
  108.             After one or more uses of the '>' command, you
  109.             might want to go back and look at the first
  110.             segment again.
  111.       o      [num]     offset addresses
  112.             All address references are adjusted by subtracting
  113.             the number before being displayed. If no number
  114.             is given, the last listing address is used. This
  115.             command is of little use, given the availability
  116.             of the below 'p' command.
  117.       p                offset by segment toggle
  118.             After a file is loaded with the 'f' command, this
  119.             will adjust all displayed addresses to offsets
  120.             from the beginning of the first segment. Thus
  121.             the segments will appear to occur in memory in
  122.             the same order they occupied the the load file.
  123.             In addition, the listing of memory locations
  124.             outside any segment of the loaded file is
  125.             suppressed, and after 'b', symbols are not
  126.             constructed for references outside the loaded
  127.             file. 'p' mode is automatic after loading a file.
  128.       k<name>          keep output in file
  129.             Subsequent listing output to the screen will also
  130.             be kept in the named file (possibly for subsequent
  131.             reassembly). The saving continues until you exit
  132.             with the 'q' command.
  133.       t                trim toggle
  134.             Suppresses or enables the display of addresses at
  135.             the left-hand side of the screen.
  136.       n<num>           print n lines after <CR>
  137.  
  138.  
  139. Notes on symbols.
  140.  
  141.       Symbols may be up to 255 characters and may contain any
  142. non-control characters.  A symbol may not be associated with the
  143. value zero or a value greater than 7FFFFFFFH. Symbols are case sensitive.
  144.  
  145.       There are some special conventions for symbols.  A symbol may
  146. carry information about the type of data being disassembled.  If a
  147. symbol starts with '.' and one of the letters 'b','a','w','l','c','i', then
  148. code at this and subsequent locations will be treated as bytes, ascii
  149. characters, words, longwords, a constant block, or instructions,
  150. respectively.  Otherwise, it will be treated as instructions.  Two character
  151. symbols beginning with '.' are not listed, since they are assumed to be
  152. intended to carry only type information.
  153.  
  154.       When a symbol starts with '.c', Dis displays 'dcb.b  <length>,<value>'
  155. where the value is that of the byte found at the address of the symbol
  156. and subsequent memory locations, and the length is the count of the number
  157. of bytes in the block. The block is considered to end when:
  158.      a byte with a different value is encountered,
  159.      an address with an associated symbol is found,
  160.       or in 'p' mode the end of a segment is reached.
  161. Dis does not do the counting of bytes in blocks very efficiently when there
  162. are lots of symbols in the table, so after 'dcb.b' has been displayed,
  163. some patience may be required.
  164.  
  165.       It is possible for a symbol to be concealed and not listed as a
  166. label at the left of the screen in some circumstances. This will happen
  167. when its address comes within an instruction being listed, or when its
  168. address is odd and a preceding address was listed as 'dc.w' or 'dc.l'.
  169. However, if a symbol with a following even address would be concealed by a
  170. 'dc.l' listing, this is prevented by listing data as bytes rather than
  171. as a longword. In 'p' mode, this is also done one word away from the
  172. end of a segment so as not to show data outside the segment.
  173.  
  174.       Symbols beginning with asterisks may be used to enter comments,
  175. in which case they are not listed as operands, but only as labels.
  176. If a single address is to have both a comment and an ordinary label
  177. associated with it, the comment should be entered after the ordinary
  178. label (else the comment will be lost).  Multiple comments for a single
  179. address are listed in the order in which they were entered. Once a
  180. comment has been entered, it can be eliminated only in the way just
  181. mentioned, or by saving the symbol table and editing it.
  182.  
  183.